<template>
  <x-table
    ref="refTable"
    name="职位"
    :top="40"
    :columns="columns"
    :highlight-current-row="true"
    :init-sort="{ seq: 'ascending' }"
    :data="tableData.resp.list"
    :total="tableData.resp.total"
    :loading="tableData.loading"
    @query="handleQuery"
    @row-click="handleRowClick"
  >
  </x-table>
</template>

<script setup lang="ts">
import { usePosition } from '@/views/system/position/hook'
import type { Position } from '@/api/modules/system/position'

const emits = defineEmits(['select'])

const { refTable, tableData, handleQuery } = usePosition()

const columns = [{ prop: 'positionName', label: '职位名称', isGbk: true }]

const handleRowClick = (role: Position) => {
  emits('select', role)
}
</script>

<style lang="scss" scoped></style>
